﻿using System.Net.DnsToolkit.Packet;
using System.Net.DnsToolkit.Packet.Records;
using System.Net.DnsToolkit.Serializer.Stream.Extension;
using System.Net.DnsToolkit.Serializer.Stream.Compression;

namespace System.Net.DnsToolkit.Serializer.Stream.Writer.Record {
    public class RecordNSWriter : IRecordWriter<System.IO.Stream> {
    
        public QTypeEnum QTypeEnum { get { return QTypeEnum.NS; } }

        public void Write(IRecord record, System.IO.Stream destination, ICompressionContext compression) {
            var ns = (IRecordNS)record;
            destination.WriteDomainName(ns.NSDNAME, (CompressionContext)compression);
        }

    }
}
